import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Period;
import java.util.Date;

public class IntefaceT implements  A{
    @Override
    public void say() {
        System.out.println("InterfaceT 的实现类");
        defaultMethod();
    }

    public static void main(String[] args) throws UnsupportedEncodingException, ParseException {

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("ye").append('c').append(12);
        System.out.println(stringBuilder.toString());

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String format = simpleDateFormat.format(new Date());
        System.out.println(format);

        Date parse = simpleDateFormat.parse("2023-09-21 22:22:22");
        System.out.println(parse );

        LocalDate of = LocalDate.of(2023, 12, 3);
        System.out.println(of);
        LocalDate now = LocalDate.now();
        System.out.println(now);
        LocalDateTime now1 = LocalDateTime.now();
        System.out.println(now1);
        System.out.println(now1.getYear());
        System.out.println(now1.getDayOfMonth());

        LocalDate now2 = LocalDate.now();
        LocalDate now3 = LocalDate.of(2025, 1, 1);
        Period between = Period.between(now2, now3);
        System.out.println(between.getYears());
        System.out.println(between.getMonths());
        System.out.println(between.getDays());
        Duration duration = Duration.between(now2,now3);

    }



}
